package com.template;

/**
 * Created by yangjun on 2018/3/23.
 */
public class ConcreteCreator extends Creator {
    @Override
    public <T extends Product> T createProduct(Class c) {
        Product product = null;

        try {
           product = (T)Class.forName(c.getName()).newInstance();
        } catch (Exception e) {
           //异常处理
        }
        return (T)product;
    }
}
